import wtforms

from packages.common.base import BaseForm, BasePageForm


class FileInfoForm(BaseForm):
    """
    文件信息表单校验类
    """
    id = wtforms.IntegerField()
    url = wtforms.StringField("文件访问地址", [wtforms.validators.DataRequired(message="文件访问地址不能为空")])
    size = wtforms.StringField("文件大小，单位字节")
    sizeInfo = wtforms.StringField("文件大小，有单位")
    filename = wtforms.StringField("文件名称")
    originalFilename = wtforms.StringField("原始文件名")
    basePath = wtforms.StringField("基础存储路径")
    path = wtforms.StringField("存储路径")
    ext = wtforms.StringField("文件扩展名")
    contentType = wtforms.StringField("MIME类型")
    platform = wtforms.StringField("存储平台")
    thUrl = wtforms.StringField("缩略图访问路径")
    thFilename = wtforms.StringField("缩略图大小，单位字节")
    thSize = wtforms.StringField("缩略图大小，单位字节")
    thSizeInfo = wtforms.StringField("缩略图大小，有单位")
    thContentType = wtforms.StringField("缩略图MIME类型")
    objectId = wtforms.StringField("文件所属对象id")
    objectType = wtforms.StringField("文件所属对象类型，例如用户头像，评价图片")
    attr = wtforms.StringField("附加属性")
    createUser = wtforms.StringField("创建用户")
    updateUser = wtforms.StringField("更新用户")


class FileInfoPageForm(BasePageForm):
    """
    文件信息分页校验类
    """
    pass
